﻿using AutoMapper;
using Himp.ShareData;
using System.Data.Common;
using Volo.Abp.AuditLogging;
using Volo.Abp.AutoMapper;
using Volo.Abp.OpenIddict.Applications;

namespace Himp.Platform;

public class PlatformApplicationAutoMapperProfile : Profile
{
    public PlatformApplicationAutoMapperProfile()
    {
        #region 机构

        CreateMap<OrganCreateDto, Organ>();
        CreateMap<OrganUpdateDto, Organ>();
        CreateMap<Organ, OrganDto>();

        #endregion

        #region 科室

        CreateMap<DeptCreateDto, Dept>();
        CreateMap<DeptUpdateDto, Dept>();
        CreateMap<Dept, DeptDto>();

        #endregion

        #region 字典

        CreateMap<CatgeDict, CatgeDictDto>();
        CreateMap<CatgeDictCreateDto, CatgeDict>();
        CreateMap<CatgeDictUpdateDto, CatgeDict>();

        CreateMap<DataDict, DataDictDto>();
        CreateMap<DataDictCreateDto, DataDict>();
        CreateMap<DataDictUpdateDto, DataDict>();

        CreateMap<BizDict, BizDictDto>();
        CreateMap<BizDictCreateDto, BizDict>();
        CreateMap<BizDictUpdateDto, BizDict>();

        CreateMap<AttrDict, AttrDictDto>();
        CreateMap<AttrDictCreateDto, AttrDict>();
        CreateMap<AttrDictUpdateDto, AttrDict>();

        CreateMap<CodgDict, CodgDictDto>();
        CreateMap<CodgDictCreateDto, CodgDict>();
        CreateMap<CodgDictUpdateDto, CodgDict>();

        CreateMap<CodgRule, CodgRuleDto>();
        CreateMap<CodgRuleCreateOrUpdateDto, CodgRule>();
        CreateMap<CodgHistory, CodgHistoryDto>();

        #endregion

        #region 菜单

        CreateMap<Menu, MenuDto>();
        CreateMap<MenuCreateDto, Menu>();
        CreateMap<MenuUpdateDto, Menu>();

        #endregion

        #region 日志

        CreateMap<AuditLog, AuditLogDto>();
        CreateMap<EntityChange, EntityChangeDto>();
        CreateMap<AuditLogAction, AuditLogActionDto>();
        CreateMap<EntityPropertyChange, EntityPropertyChangeDto>();

        #endregion

        #region 消息

        CreateMap<EventMsgSendRec, MsgSendRecDto>();
        CreateMap<MsgSendRecCreateDto, EventMsgSendRec>();


        CreateMap<EventMsgTopic, EventMsgTopicDto>();
        CreateMap<EventMsgTopicUpdateDto, EventMsgTopic>();
        CreateMap<EventMsgTopicCreateDto, EventMsgTopic>();
        CreateMap<EventMsgRecvRec, EventMsgRecvRecDto>();

        #endregion

        #region 应用

        CreateMap<OpenIddictApplication, OpenIddictAppDto>();

        #endregion

        #region low-code

        CreateMap<AppModule, AppModuleDto>();
        CreateMap<AppModuleCreateDto, AppModule>();
        CreateMap<AppModuleUpdateDto, AppModule>();

        CreateMap<AppTopic, AppTopicDto>();
        CreateMap<AppTopicCreateDto, AppTopic>();
        CreateMap<AppTopicUpdateDto, AppTopic>();
        
        CreateMap<DataFormDict, StdFormDictDto>();
        CreateMap<StdFormDictCreateDto, DataFormDict>();
        CreateMap<StdFormDictUpdateDto, DataFormDict>();

        CreateMap<DataModelPropertyDict, DataModelPropertyDictDto>();
        CreateMap<DataModelPropertyDictCreateDto, DataModelPropertyDict>();
        CreateMap<DataModelPropertyDictUpdateDto, DataModelPropertyDict>();

        CreateMap<DataModelExtPropertyDict, DataModelExtPropertyDictDto>();
        CreateMap<DataModelExtPropertyDictCreateDto, DataModelExtPropertyDict>();
        CreateMap<DataModelExtPropertyDictUpdateDto, DataModelExtPropertyDict>();

        CreateMap<EventModelPropertyDict, EventModelPropertyDictDto>();
        CreateMap<EventModelPropertyDictCreateDto, EventModelPropertyDict>();
        CreateMap<EventModelPropertyDictUpdateDto, EventModelPropertyDict>();

        CreateMap<DataTableRestrRule, DataTableRestrRuleDto>();
        CreateMap<DataTableRestrRuleCreateDto, DataTableRestrRule>();
        CreateMap<DataTableRestrRuleUpdateDto, DataTableRestrRule>();

        CreateMap<OpenApiFuncConfig, OpenApiFuncConfigDto>();
        CreateMap<OpenApiFuncConfigCreateOrUpdateDto, OpenApiFuncConfig>();

        #region 标准字典

        CreateMap<StdWordDict, StdWordDictDto>();
        CreateMap<StdWordDictCreateDto, StdWordDict>();
        CreateMap<StdWordDictUpdateDto, StdWordDict>();

        CreateMap<StdDomainDict, StdDomainDictDto>();
        CreateMap<StdDomainDictCreateDto, StdDomainDict>();
        CreateMap<StdDomainDictUpdateDto, StdDomainDict>();

        CreateMap<StdPhrDict, StdPhrDictDto>();
        CreateMap<StdPhrDictCreateDto, StdPhrDict>();
        CreateMap<StdPhrDictUpdateDto, StdPhrDict>();

        CreateMap<DataModelDict, DataModelDictDto>();
        CreateMap<DataModelDictCreateDto, DataModelDict>();
        CreateMap<DataModelDictUpdateDto, DataModelDict>();

        CreateMap<EventModelDict, EventModelDictDto>();
        CreateMap<EventModelDictCreateDto, EventModelDict>();
        CreateMap<EventModelDictUpdateDto, EventModelDict>();

        CreateMap<DataTableDict, DataTableDictDto>();
        CreateMap<DataTableDictCreateDto, DataTableDict>();
        CreateMap<DataTableDictUpdateDto, DataTableDict>();

        CreateMap<DataTableColumn, DataTableColumnDto>();
        CreateMap<DataTableColumnCreateDto, DataTableColumn>();
        CreateMap<DataTableColumnUpdateDto, DataTableColumn>();

        CreateMap<DataViewDict, DataViewDictDto>();
        CreateMap<DataViewDictCreateDto, DataViewDict>();
        CreateMap<DataViewDictUpdateDto, DataViewDict>();

        CreateMap<DataViewContainerDict, DataViewContainerDictDto>();
        CreateMap<DataViewContainerDictCreateDto, DataViewContainerDict>();
        CreateMap<DataViewContainerDictUpdateDto, DataViewContainerDict>();

        #endregion

        #region 工作流

        CreateMap<AppBizflow, AppBizflowDto>();
        CreateMap<AppBizflowUpdateDto, AppBizflow>();
        CreateMap<AppBizflowCreateDto, AppBizflow>();

        CreateMap<AppBiznode, AppBiznodeDto>();
        CreateMap<AppBiznodeCreateDto, AppBiznode>();
        CreateMap<AppBiznodeUpdateDto, AppBiznode>();

        CreateMap<WorkflowModel, WorkflowModelDto>();
        CreateMap<WorkflowInstance, WorkflowInstanceDto>();

        #endregion

        #endregion

        #region 患者

        CreateMap<PatnMasterIdx, PatnMasterIdxDto>();
        CreateMap<PatnBaseInfo, PatnBaseInfoDto>();
        CreateMap<PatnCardInfo, PatnCardInfoDto>();

        #endregion

        #region 公共项目

        CreateMap<PubItem, PubItemDto>();
        CreateMap<PubItemUpdateDto, PubItem>();
        CreateMap<PubItemCreateDto, PubItem>();

        CreateMap<AgmtItem, AgmtItemDto>();
        CreateMap<PubItemAssocChrgitmType, PubItemAssocChrgitmTypeDto>();
        CreateMap<PubItemBilgGrant, PubItemBilgGrantDto>();
        CreateMap<PubItemExecGrant, PubItemExecGrantDto>();

        #endregion

        #region 疾病诊断

        CreateMap<ClncDiagDict, ClncDiagDictDto>();
        CreateMap<ClncDiagDictUpdateDto, ClncDiagDict>();
        CreateMap<ClncDiagDictCreateDto, ClncDiagDict>();

        CreateMap<TcmDiseDict, TcmDiseDictDto>();
        CreateMap<TcmDiseDictCreateOrUpdateDto, TcmDiseDict>();

        CreateMap<TcmsympDict, TcmsympDictDto>();
        CreateMap<TcmsympDictCreateOrUpdateDto, TcmsympDict>();

        #endregion
    }
}
